#version 330 core
layout (location = 0) in vec3 aVertexPos;//顶点坐标
layout (location = 1) in vec3 aVertexColor;//顶点颜色
uniform vec3 modelCol;	//模型整体颜色
uniform int useVertexColor;	//是否使用顶点颜色，0：使用设置模型的整体颜色；1：使用顶点颜色

out vec3 ourColor;

//MVP
uniform mat4 modelMatrix;
uniform mat4 viewMatrix;
uniform mat4 projectionMatrix;

void main()
{
	gl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(aVertexPos, 1.0);
	ourColor = modelCol*(1-useVertexColor) + aVertexColor*useVertexColor;
}